{% extends "web/base.html" %}

{% block mainbody %}
    <div class="container">
        <div class="col-md-4">
            <div class="panel panel-warning">
                <div class="panel-heading"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> 购 物 车</div>
                <table class="table table-striped">
                        <tr>
                            <th width="30">序</th>
                            <th width="150">菜品</th>
                            <th width="72">数量</th>
                            <th width="45">单价</th>
                            <th>删除</th>
                        </tr>
                        {% for food in request.session.foodlist.values %}
                        <tr>
                            <td>{{ forloop.counter }}</td>
                            <td>{{ food.name }}</td>
                            <td class="num">{% if food.m == 1 %}<i class="btn btn-default btn-xs disabled"> {% else %} <i onclick="window.location='{% url 'cart_change' %}?pid={{food.id}}&num={{food.m|add:-1}}'" class="btn btn-default btn-xs"> {% endif %} - </i><span>{{ food.m }}</span><i onclick="window.location='{% url 'cart_change' %}?pid={{food.id}}&num={{food.m|add:1}}'" class="btn btn-default btn-xs"> + </i></td>
                            <td class="price">{{ food.price }}</td>
                            <td><a href="{% url 'cart_del' food.id %}" class="btn btn-danger btn-xs" role="button">删除</a></td>
                        </tr>
                        {% endfor %}
                    </table>
                    
                    <li class="list-group-item">
                        <b>购买方式: &nbsp; </b>  
                        <input type="radio" name="ptype" checked value="1"> 堂吃 &nbsp; 
                        <input type="radio" name="ptype" value="2"> 打包 &nbsp; 
                    </li>
                    <li class="list-group-item">
                        <b>支付方式: &nbsp; </b> 
                        <input type="radio" name="bank" checked value="1"> 现金 &nbsp; 
                        <input type="radio" name="bank" value="2"> 支付宝 &nbsp; 
                        <input type="radio" name="bank" value="3"> 微信
                    </li>

                    <div class="panel-footer" style="height:50px">
                        <div style="width:120px;float:left;margin:5px 0px;">合计：￥<span style="color:red;font-weight:bold;">{{ request.session.totalprice }}</span> 元</div>
                        <button type="button" onclick="dosubmit()" class="btn btn-warning" style="width:80px;float:right">结&nbsp;算</button>
                        <a href="{% url 'cart_clear' %}" class="btn btn-danger" style="width:60px;float:right;margin-right:20px;">清&nbsp;空</a>
                    </div>
             
            </div>
        </div>
        <div class="col-md-8">
            <!--标签页内容-->
            {% for vo in clist %}
            <h5 style="padding-bottom:9px;border-bottom:1px solid #eee;color:#BB3D00"><span class="glyphicon glyphicon-list" aria-hidden="true"> {{ vo.name }} </h5>
            <div class="row shoplist">
                {% for product in vo.pids %}
                <div class="col-sm-6 col-md-3">
                    <div class="thumbnail1">
                      <img src="/static/web/static/images/{{ product.cover_pic }}" width="150px" height="100px" alt="...">
                      <div class="caption">
                        <h6>{{ product.name }}</h6>
                        <div class="bn">￥<span class="price">{{ product.price }}</span>元</a>
                        <a href="{% url 'cart_add' product.id %}" class="btn btn-warning btn-xs pull-right" role="button"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> 购买</a></div>
                      </div>
                    </div>
                </div>
                {% endfor %}
            </div> 
            {% endfor %}  
          
        </div>
    </div>

{% endblock %}

